<?php

declare(strict_types=1);

namespace App\Request;

use Hyperf\Validation\Request\FormRequest;

class AdminRegisterRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        $rule =  [
            'username' => 'required|unique:admin,username,id',
            //'email' => 'required|email|unique:admin,email,id',
            'password' => 'required|confirmed|min:6',
            'real_name' => 'required',
            'area_ids' => 'required',
            'contact_tel' => 'required|max:11|regex:/^1\d{10}$/'
        ];
        return $rule;
    }
}
